package com.zb.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.zb.annotation.NumberPattern;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/10/28 0028
 **/
@Data
@ApiModel("工单备件物料审核对象")
public class WorkSpareMaterialCheckVo {

    @NotNull(message = "备件物料ID不能为空")
    @ApiModelProperty(value = "备件物料ID", required = true)
    private Long id;

    @NotNull(message = "备件物料审核状态不能为空")
    @NumberPattern(regexp = "^(2|3)$", message = "备件物料审核状态参数不合法")
    @ApiModelProperty(value = "备件物料审核状态：2-已通过，3-已驳回", required = true, example = "2")
    private Integer status;

    @NotNull(message = "结算类型不能为空")
    @NumberPattern(regexp = "^(1|2)$", message = "结算类型参数不合法")
    @ApiModelProperty(value = "收支类型：1-品牌商家承担，2-平台承担", required = true, example = "1")
    private Integer type;

    @NotNull(message = "备件ID不能为空")
    @ApiModelProperty(value = "备件ID", required = true)
    private Long spareId;

    @NotNull(message = "备件规格ID不能为空")
    @ApiModelProperty(value = "备件规格ID", required = true)
    private Long specId;

    @NotNull(message = "备件物料数量不能为空")
    @Min(value = 1, message = "备件物料数量最小值为1")
    @ApiModelProperty(value = "备件物料数量", required = true, example = "1")
    private Integer qty;

    @NotNull(message = "平台承担费用不能为空")
    @Digits(integer = 8, fraction = 2, message = "允许输入 8 位整数，小数允许输入 2 位")
    @Min(value = 0, message = "物料单价最小值为0，不可输入小于0的单价")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "费用金额最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "平台承担费用", required = true, example = "0.0")
    private BigDecimal price;

    @NotNull(message = "向服务商支付费用不能为空")
    @Min(value = 0, message = "物料单价最小值为0，不可输入小于0的单价")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "费用金额最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "向服务商支付费用", required = true, example = "0.0")
    private BigDecimal payNetworkPrice;

    @NotNull(message = "收取商家费用不能为空")
    @Min(value = 0, message = "物料单价最小值为0，不可输入小于0的单价")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "费用金额最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "收取商家费用", required = true, example = "0.0")
    private BigDecimal receiveFactoryPrice;

    @NotNull(message = "仓库不能为空")
    @ApiModelProperty(value = "仓库ID", required = true, example = "0")
    private Long storeId;

    @ApiModelProperty(value = "仓库仓位ID，当仓库启用仓位时，此字段必填", example = "0")
    private Long storePositionId;

    @NotNull(message = "备件质保状态不能为空")
    @ApiModelProperty(value = "质保状态：false-保内，true-保外", required = true, example = "false")
    private Boolean overinsured;

    @Length(max = 200, message = "备注长度限制 200 个字符")
    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "工单服务费用图片对象")
    private List<OrderImageVo> images;

    @ApiModelProperty(value = "删除的工单费用图片对象ID")
    private List<Long> delImageIds;
}
